﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DispatchAssist.BusinessLogical.Model;

namespace DispatchAssist.Model
{
    public class ClientMessageInfo
    {
        public List<NormalAlertInfo> NormalAlertList;

        public List<SMSAlertAllInfo> SMSAlertList;

        public List<SeatLogin> SeatLoginList;

        public List<SeatRelation> RelationSeats;

        public ClientMessageInfo GetAlertMessageByAlertAction(int alertAction)
        {
            ClientMessageInfo cminfo = new ClientMessageInfo();


            if (alertAction == (int)(Enums.AlertActionFlag.AutoSendSMSAlert | Enums.AlertActionFlag.ConfirmSMS) || alertAction == (int)(Enums.AlertActionFlag.ManualSendSMSAlert))
            {
                if (SMSAlertList != null && SMSAlertList.Count > 0)
                {


                    List<SMSAlertAllInfo> SMSList;
                    SMSList = SMSAlertList.Where(f => f.AlertActionFlag == alertAction).ToList();
                    cminfo.SMSAlertList = SMSList;
                }

            }
            else
            {
                if (NormalAlertList != null && NormalAlertList.Count > 0)
                {
                    List<NormalAlertInfo> NormalList;
                    NormalList = NormalAlertList.Where(f => f.AlertActionFlag == alertAction).ToList();

                    cminfo.NormalAlertList = NormalList;
                }
            }
            return cminfo;
        }
    }

    public class SysGlobal
    {

        public static List<NormalAlertInfo> oldNormalAlertInfoList = null;
        public static List<SMSAlertAllInfo> oldSMSAlertAllInfoList = null;


    }




}
